package com.ruoyi.system.service.zhaungxiuservice.shopService.impl;

import java.util.List;

import com.ruoyi.system.domain.zhuangxiumain.orderformMain.OrderCart;
import com.ruoyi.system.mapper.zhuangxiumapper.orderformMapper.OrderCartMapper;
import com.ruoyi.system.service.zhaungxiuservice.shopService.IOrderCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 购物车Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-31
 */
@Service
public class OrderCartServiceImpl implements IOrderCartService
{
    @Autowired
    private OrderCartMapper orderCartMapper;

    /**
     * 查询购物车
     *
     * @param cartId 购物车ID
     * @return 购物车
     */
    @Override
    public OrderCart selectOrderCartById(Integer cartId)
    {
        return orderCartMapper.selectOrderCartById(cartId);
    }

    /**
     * 查询购物车列表
     *
     * @param orderCart 购物车
     * @return 购物车
     */
    @Override
    public List<OrderCart> selectOrderCartList(OrderCart orderCart)
    {
        return orderCartMapper.selectOrderCartList(orderCart);
    }

    /**
     * 新增购物车
     *
     * @param orderCart 购物车
     * @return 结果
     */
    @Override
    public int insertOrderCart(OrderCart orderCart)
    {
        return orderCartMapper.insertOrderCart(orderCart);
    }

    /**
     * 修改购物车
     *
     * @param orderCart 购物车
     * @return 结果
     */
    @Override
    public int updateOrderCart(OrderCart orderCart)
    {
        return orderCartMapper.updateOrderCart(orderCart);
    }

    /**
     * 批量删除购物车
     *
     * @param cartIds 需要删除的购物车ID
     * @return 结果
     */
    @Override
    public int deleteOrderCartByIds(Integer[] cartIds)
    {
        return orderCartMapper.deleteOrderCartByIds(cartIds);
    }

    /**
     * 删除购物车信息
     *
     * @param cartId 购物车ID
     * @return 结果
     */
    @Override
    public int deleteOrderCartById(Integer cartId)
    {
        return orderCartMapper.deleteOrderCartById(cartId);
    }

    @Override
    public List<OrderCart> selectOrderusertById(Integer parseInt) {
        return orderCartMapper.selectOrderusertById(parseInt);
    }
}
